<?php
if (! defined ( 'BASEPATH' ))
	exit ( 'No direct script access allowed' );
	
class CT_Input extends CI_Input {
	
	public function __construct() {
		parent::__construct ();
	}
	
	public function get_int($index = NULL, $xss_clean = FALSE)
	{
		$int = $this->get($index, $xss_clean);
		if(is_numeric($int)) {
			return $int;
		}
		return 0;
	}
	
	public function post_int($index = NULL, $xss_clean = FALSE)
	{
		$int = $this->post($index, $xss_clean);
		if(is_numeric($int)) {
			return $int;
		}
		return 0;
	}
	
	public function get_post_int($index = NULL, $xss_clean = FALSE)
	{
		$int = $this->get_post_int($index, $xss_clean);
		if(is_numeric($int)) {
			return $int;
		}
		return 0;
	}
	
	public function is_method($m)
	{
	    return $_SERVER['REQUEST_METHOD'] === strtoupper($m);
	}
}
?>